#!/usr/bin/env python

import struct

fin = open('bin.wav', 'rb')
fout = open('bin_inv.wav', 'wb')
token = fin.read(4)
idx = 0
while token:
    i = struct.unpack('=I', token)[0]
    if idx < 11:
        fout.write(token)
    else:
        out = struct.pack('>I', i)
        fout.write(out)
    token = fin.read(4)
    idx += 1
fout.close()
fin.close()
